import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userPlayList: [],
    nowmusicmenu: {},
    nowmusic: '',
    isPlaying: true,
    uid: null
  },
  getters: {
    getUserSonglist (state) {
      if (state.userPlayList.length > 0) {
        return state.userPlayList
      }
    }
  },
  mutations: {
    saveUserID (state, id) {
      state.uid = id
    }
  },
  actions: {},
  modules: {}
})
